<?php

use yii\helpers\Html;
use yii\grid\GridView;
use app\modules\clinical\models\ExcelPd;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'PD门诊表格搜索';
$this->registerJsFile('@web/js/search.js', ['depends' => 'app\assets\AppAsset']);

$params = ExcelPd::getParams();
?>
<style type="text/css">
    .search-div > div > table {width: 7000px !important;}
    .med-search {width: auto; display: inline;}
</style>


<p>
    <?= Html::a('清空搜索', ['/search/excel'], ['class' => 'btn btn-primary']) ?>
    <?= Html::a('详情搜索', '#', ['class' => 'btn btn-success', 'id' => 'chooseButton']) ?>
</p>

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        [
            'class' => 'yii\grid\ActionColumn',
            'buttons' =>[
                'view' => function($url, $model, $key) {
                    return Html::a('<i class="fa fa-paper-plane"></i>', '/search/search/enter/?id='.$model->pt_id.'&type=excel');
                },
            ],
            'template' => '{view}',
        ],
		[
            'attribute' => 'ft_ill_time',
            'value' => function($model) {
                return date("Y-m", $model->ft_ill_time);
            },
            'filterInputOptions' => ['class' => 'form-control laydate-icon date'],
        ],
        [
            'attribute' => 'ft_md_time',
            'value' => function($model) {
                return date("Y-m", $model->ft_md_time);
            },
            'filterInputOptions' => ['class' => 'form-control laydate-icon time'],
        ],
        [
            'attribute' => 'up_time',
            'filterInputOptions' => ['class' => 'form-control laydate-icon time'],
        ],
        [
            'attribute' => 'bf_time',
            'filterInputOptions' => ['class' => 'form-control laydate-icon time'],
        ],
        [
            'attribute' => 'lc_time',
            'filterInputOptions' => ['class' => 'form-control laydate-icon time'],
        ],
        [
            'attribute' => 'dn_time',
            'filterInputOptions' => ['class' => 'form-control laydate-icon time'],
        ],
        [
            'attribute' => 'sl_time',
            'filterInputOptions' => ['class' => 'form-control laydate-icon time'],
        ],
		'ft_symptom',
		'ft_process',
		'else_ctnt',
        [
            'attribute' => 'ft_part',
            'value' => function($model) {
                    return $params['illPart'][$model->ft_part];
                },
                'filter' => $params['illPart'],
        ],
        [
            'attribute' => 'treatment',
            'value' => function($model) {
                    return $params['operation'][$model->treatment];
                },
                'filter' => $params['operation'],
        ],
        [
            'attribute' => 'q_1',
            'value' => function($model) {
                    return $params['yesno'][$model->q_1];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_2',
            'value' => function($model) {
                    return $params['yesno'][$model->q_2];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_3',
            'value' => function($model) {
                    return $params['yesno'][$model->q_3];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_4',
            'value' => function($model) {
                    return $params['yesno'][$model->q_4];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_5',
            'value' => function($model) {
                    return $params['yesno'][$model->q_5];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_6',
            'value' => function($model) {
                    return $params['yesno'][$model->q_6];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_7',
            'value' => function($model) {
                    return $params['yesno'][$model->q_7];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_8',
            'value' => function($model) {
                    return $params['yesno'][$model->q_8];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_9',
            'value' => function($model) {
                    return $params['yesno'][$model->q_9];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_10',
            'value' => function($model) {
                    return $params['yesno'][$model->q_10];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_11',
            'value' => function($model) {
                    return $params['yesno'][$model->q_11];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_12',
            'value' => function($model) {
                    return $params['yesno'][$model->q_12];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_13',
            'value' => function($model) {
                    return $params['yesno'][$model->q_13];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_14',
            'value' => function($model) {
                    return $params['yesno'][$model->q_14];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_15',
            'value' => function($model) {
                    return $params['yesno'][$model->q_15];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_16',
            'value' => function($model) {
                    return $params['yesno'][$model->q_16];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_17',
            'value' => function($model) {
                    return $params['yesno'][$model->q_17];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_18',
            'value' => function($model) {
                    return $params['yesno'][$model->q_18];
                },
                'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_19',
            'value' => function($model) {
                return $params['yesno'][$model->q_19];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_20',
            'value' => function($model) {
                return $params['yesno'][$model->q_20];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_21',
            'value' => function($model) {
                return $params['yesno'][$model->q_21];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_22',
            'value' => function($model) {
                return $params['yesno'][$model->q_22];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_23',
            'value' => function($model) {
                return $params['yesno'][$model->q_23];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_24',
            'value' => function($model) {
                return $params['yesno'][$model->q_24];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_25',
            'value' => function($model) {
                return $params['yesno'][$model->q_25];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_26',
            'value' => function($model) {
                return $params['yesno'][$model->q_26];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_27',
            'value' => function($model) {
                return $params['yesno'][$model->q_27];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_28',
            'value' => function($model) {
                return $params['yesno'][$model->q_28];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_29',
            'value' => function($model) {
                return $params['yesno'][$model->q_29];
            },
            'filter' => $params['yesno'],
        ],
        [
            'attribute' => 'q_30',
            'value' => function($model) {
                return $params['yesno'][$model->q_30];
            },
            'filter' => $params['yesno'],
        ],
    ],
]); ?>
